Security News
Research
Data Theft Repackaged: A Case Study in Malicious Wrapper Packages on npm
The Socket Research Team breaks down a malicious wrapper package that uses obfuscation to harvest credentials and exfiltrate sensitive data.
@cspell/cspell-types
Advanced tools
@cspell/cspell-types is a TypeScript library that provides type definitions for the CSpell spelling checker configuration. It allows developers to define and manage spelling configurations programmatically, ensuring that their spelling rules are consistent and easily maintainable.
Define CSpell Configuration
This feature allows you to define a CSpell configuration using TypeScript. You can specify the language, custom words, paths to ignore, and dictionaries to use.
{
"import { CSpellUserSettings } from '@cspell/cspell-types';
const config: CSpellUserSettings = {
language: 'en',
words: ['typescript', 'npm'],
ignorePaths: ['node_modules', 'dist'],
dictionaries: ['softwareTerms']
};
console.log(config);"
}
Extend Existing Configuration
This feature demonstrates how to extend an existing CSpell configuration. You can merge configurations to add new words or ignore paths while keeping the base configuration intact.
{
"import { CSpellUserSettings } from '@cspell/cspell-types';
const baseConfig: CSpellUserSettings = {
language: 'en',
words: ['typescript']
};
const extendedConfig: CSpellUserSettings = {
...baseConfig,
words: [...baseConfig.words, 'npm'],
ignorePaths: ['node_modules']
};
console.log(extendedConfig);"
}
Validate Configuration
This feature allows you to validate a CSpell configuration to ensure it meets the required schema. The `validateConfig` function checks the configuration and returns any validation errors.
{
"import { CSpellUserSettings, validateConfig } from '@cspell/cspell-types';
const config: CSpellUserSettings = {
language: 'en',
words: ['typescript', 'npm'],
ignorePaths: ['node_modules', 'dist'],
dictionaries: ['softwareTerms']
};
const validationResult = validateConfig(config);
console.log(validationResult);"
}
ESLint is a tool for identifying and reporting on patterns found in ECMAScript/JavaScript code. It helps developers maintain code quality and consistency. Unlike @cspell/cspell-types, which focuses on spelling, ESLint focuses on code linting and style enforcement.
Stylelint is a linter for CSS and other style sheet languages. It helps developers avoid errors and enforce consistent conventions in their styles. While @cspell/cspell-types is for spelling configurations, Stylelint is specifically for style sheet linting.
Prettier is an opinionated code formatter that supports many languages. It enforces a consistent style by parsing your code and re-printing it with its own rules. Unlike @cspell/cspell-types, which is for spelling configurations, Prettier focuses on code formatting.
Contains cspell types and json-schema.
This package contains no dependencies to avoid any security issues.
npm i -S @cspell/cspell-types
Can be use to make writing cspell.config.js
files easier.
'use strict';
/** @type { import("@cspell/cspell-types").CSpellUserSettings } */
const cspell = {
description: 'cspell.config.js file in samples/js-config',
languageSettings: [
{
languageId: 'cpp',
allowCompoundWords: false,
patterns: [
{
name: 'pound-includes',
pattern: /^\s*#include.*/g
}
],
ignoreRegExpList: ['pound-includes']
}
],
dictionaryDefinitions: [
{
name: 'custom-words',
path: './custom-words.txt'
}
],
dictionaries: ['custom-words']
};
module.exports = cspell;
CSpellSettings
alias CSpellUserSettings
is the formal definition of the configuration that controls the spell checker.
Available as part of the Tidelift Subscription.
The maintainers of cspell and thousands of other packages are working with Tidelift to deliver commercial support and maintenance for the open source packages you use to build your applications. Save time, reduce risk, and improve code health, while paying the maintainers of the exact packages you use. Learn more.
Brought to you by Street Side Software
FAQs
Types for cspell and cspell-lib
The npm package @cspell/cspell-types receives a total of 697,475 weekly downloads. As such, @cspell/cspell-types popularity was classified as popular.
We found that @cspell/cspell-types demonstrated a healthy version release cadence and project activity because the last version was released less than a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Security News
Research
The Socket Research Team breaks down a malicious wrapper package that uses obfuscation to harvest credentials and exfiltrate sensitive data.
Research
Security News
Attackers used a malicious npm package typosquatting a popular ESLint plugin to steal sensitive data, execute commands, and exploit developer systems.
Security News
The Ultralytics' PyPI Package was compromised four times in one weekend through GitHub Actions cache poisoning and failure to rotate previously compromised API tokens.